<style type="text/css">

	table 
		{
		width:100%;
		}
	th
		{
		height:50px;
		}     
	 td
		{
		text-align: <?php if(Yii::app()->language == 'ar')  echo "right"; else echo "left"; ?>;
		}
	
</style>   

<script type="text/javascript">
function showMore(){
	if(document.getElementById("more").style.display=='')
		document.getElementById("more").style.display="none";
	else
		document.getElementById("more").style.display="";
	 
}

function goRegister(){
	location.href="<?php echo  Yii::app()->getBaseUrl(true) ;?>/user/register";
}

function goAdd(){
	location.href="<?php echo  Yii::app()->getBaseUrl(true) ;?>/profession/create";
}

function goPropose(){
	location.href="<?php echo  Yii::app()->getBaseUrl(true) ;?>/proposal/create";
}

function goReport(){
	location.href="<?php echo  Yii::app()->getBaseUrl(true) ;?>/proposal/reportBug";
}


</script>

<?php
/* @var $this SiteController */

$this->pageTitle=Yii::app()->name;
?>

<div style="text-align: center;">
<img src="<?php echo Yii::app()->request->baseUrl ?>/images/logo3_beta.jpg" alt="7eraf">
</div><div class="wide form">
<h1 style="text-align: center;font-size:50px"><?php echo Yii::t('default','hoya'); ?></h1>

<p><?php // echo Yii::t('default','construct'); ?></p>

<!-- <br/><br/><br/> -->



<?php /* echo TbHtml::carousel(array(
		array('image' => Yii::app()->request->baseUrl.'/images/underconstruction.jpg', 'label' => 'WebSite is under construction', 'caption' => 'we do our best'),
		array('image' => Yii::app()->request->baseUrl.'/images/help.jpg', 'label' => 'Help Us', 'caption' => 'please help us growing our database and expanding our idea'),
		
),
		array('style'=>'width:90%;margin:auto')); */ ?>

<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'action'=>Yii::app()->createUrl($this->route),
	'method'=>'get',
)); ?>
		
	<table style="width: 100%">
	<tr style="width: 100%"><td colspan="3" style="text-align: center;">
		<?php echo TbHtml::well(Yii::t('default','home.message'), array('size' => TbHtml::WELL_SIZE_DEFAULT,'style'=>'width:90%;margin:auto;color: #993333;')); ?>
	</td></tr>
	<tr style="width: 100%"><td colspan="3">
	<?php echo $form->textFieldControlGroup($model,'name',array('span'=>11,'maxlength'=>256,'placeholder' => Yii::t('profession_messages','search.profession.name'), 'label' => false,'style' => 'height:35px;')); ?>
	</td></tr>
	<tr style="width: 100%"><td >
	<?php echo $form->dropDownList($model, 'professionType_id',
       				 CHtml::listData(ProfessionType::model()->findAll(), 'id', 'nameLocalized'), array('span'=>3,'prompt' => Yii::t('profession_messages','search.all.professionTypes'), 'style' => 'height:35px;')); ?>
			
	</td><td>				
						 <?php
			                echo $form->dropDownList($model,'state_id', CHtml::listData(State::model()->findAll(), 'id', 'nameLocalized'), array(
			                    'prompt' => Yii::t('profession_messages','search.all.states'),
								'span'=>3,
								'style' => 'height:35px;',
			                    'ajax' => array(
			                        'type' => 'POST',
			                        'url' => CController::createUrl('profession/ajaxGetRegionsSearch'),
			                        'update' => '#region_id',
			                        'data' => array('state_id' => 'js:this.value'),
			                        )));
			
			                ?>
					</td>
					
					<td>
						<?php echo $form->dropDownList($model,'region_id', CHtml::listData(Region::model()->findAll('state_id=:state_id',array(':state_id'=>$model->state_id)), 'id', 'nameLocalized'),array('span'=>3,'prompt' => Yii::t('profession_messages','search.all.regions'),'id'=>'region_id','style' => 'height:35px;')); ?>
						 
					</td>
		</tr>
		<tr><td colspan="3"></td></tr>
		<tr><td><a href="#" id="moreB" onclick="showMore();"><?php echo Yii::t('default','more.options');?></a></td></tr>
		<tr id='more' style="display: none;"><td colspan="3">
		<table>
		<tr><td>
			 <?php echo $form->textFieldControlGroup($model,'mobile',array('span'=>5,'placeholder' => Yii::t('profession_messages','profession.mobile'), 'label' => false,'style' => 'height:25px;')); ?>

		</td><td>
	        <?php echo $form->textFieldControlGroup($model,'email',array('span'=>5,'maxlength'=>256,'placeholder' => Yii::t('profession_messages','profession.email'), 'label' => false,'style' => 'height:25px;')); ?>
					
		</td></tr>
		</table>
		
		</td></tr>
	
	<tr  style="width: 100%"><td colspan="3" style="text-align: center;">
        <?php echo TbHtml::submitButton(Yii::t('default','search.label'),  array('color' => TbHtml::BUTTON_COLOR_PRIMARY,'size'=>TbHtml::BUTTON_SIZE_LARGE,));?>
    
	</td></tr>
 <?php $this->endWidget(); ?>
 </table>
 <div style="height: 20px"></div>
 <hr style="border: 3px solid"/>
 
 <table style="background-color: #CFD1CF;color: #993333;">
		<tr><td style="width: 50%">
			<div>
			<br/>
			<?php if(Yii::app()->user->isGuest){ ?>
				<p><?php echo Yii::t('default','helpUs') ?> </p><p><?php echo TbHtml::button(Yii::t('default','register.now'),array('color' => TbHtml::BUTTON_COLOR_PRIMARY, 'size' => TbHtml::BUTTON_SIZE_LARGE,'onclick'=>'goRegister();')); ?></p>
	      		<p><?php echo Yii::t('default','social.login') ?> <?php $this->widget('application.modules.hybridauth.widgets.renderProviders');	 ?>	</p>
	      	<?php } else{?>
	      		<p><?php echo Yii::t('default','helpUs2') ?> </p><p><?php echo TbHtml::button(Yii::t('default','add.now'),array('color' => TbHtml::BUTTON_COLOR_PRIMARY, 'size' => TbHtml::BUTTON_SIZE_LARGE,'onclick'=>'goAdd();')); ?></p>
	      	
	      	<?php } ?>	
			</div>
		
		</td><td>
		<div>
		<p><?php echo Yii::t('default','proposal.message') ?> </p><p><?php echo TbHtml::button(Yii::t('default','propose.now'),array('color' => TbHtml::BUTTON_COLOR_PRIMARY, 'size' => TbHtml::BUTTON_SIZE_DEFAULT,'onclick'=>'goPropose();')); ?></p>
		<p><?php echo Yii::t('default','bug.message') ?> </p><p><?php echo TbHtml::button(Yii::t('default','bug.report'),array('color' => TbHtml::BUTTON_COLOR_PRIMARY, 'size' => TbHtml::BUTTON_SIZE_DEFAULT,'onclick'=>'goReport();')); ?></p>
	      		
	      		
		
		</div>
		</td></tr>
		</table>

</div>
